import { nilAxiosInstance, defAxiosInstance } from ".."

// 公开组


// 鉴权组
export const salePub = (goodId: number, minPrice: number, num: number, waitType: string) => {
  console.log({
    goodId: goodId,
    minPrice: minPrice,
    num: num,
    waitType: waitType,
  });
  
  return defAxiosInstance({
      url: "/dealcenter/def/sale",
      method: "post",
      data: {
        goodId: goodId,
        minPrice: minPrice,
        num: num,
        waitType: waitType,
      }
  })
}
export const buyPub = (goodId: number, maxPrice: number, num: number, waitType: string) => {
  return defAxiosInstance({
      url: "/dealcenter/def/buy",
      method: "post",
      data: {
        goodId: goodId,
        maxPrice: maxPrice,
        num: num,
        waitType: waitType,
      }
  })
}

export const buyList = (stat: string, part: number, page: number, pmax: number) => {
  return defAxiosInstance({
      url: "/dealcenter/def/buy/list",
      method: "get",
      params: {
        stat,
        part,
        page,
        pmax
      }
  })
}
export const buyDelete = (buyId: number) => {
  return defAxiosInstance({
      url: "/dealcenter/def/buy/" + buyId,
      method: "delete"
  })
}

export const saleList = (stat: string, part: number, page: number, pmax: number) => {
  return defAxiosInstance({
      url: "/dealcenter/def/sale/list",
      method: "get",
      params: {
        stat,
        part,
        page,
        pmax
      }
  })
}
export const saleDelete = (saleId: number) => {
  return defAxiosInstance({
      url: "/dealcenter/def/sale/" + saleId,
      method: "delete"
  })
}

export const dealList = (stat: string, part: number, page: number, pmax: number) => {
  return defAxiosInstance({
      url: "/dealcenter/def/deal/list",
      method: "get",
      params: {
        stat,
        part,
        page,
        pmax
      }
  })
}
export const dealDelete = (dealId: number) => {
  return defAxiosInstance({
      url: "/dealcenter/def/deal/" + dealId,
      method: "delete"
  })
}
export const dealConfirmLink = (dealId: number) => {
  return defAxiosInstance({
      url: "/dealcenter/def/deal/"+ dealId +"/link",
      method: "get"
  })
}